<!-- 图片预览 -->
<template>
  <div>
    <el-image-viewer v-if="imgVisible" ref="imageViewer" style="z-index:3000" :on-close="closeViewer" :url-list="url_list" />
  </div>
</template>
<script>
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
export default {
  name: "imageView",
  components: { ElImageViewer },
  data(){
    return{
      imgVisible:false,
      url_list: []
    }
  },
  created(){
    eventBus.$on("imgViewer",data=>{
      this.imgVisible=true
      this.url_list=data
    });
  },
  methods: {
    closeViewer() {
      this.imgVisible=false
    },
  }
}
</script>
<style scoped lang="less">
::v-deep .el-image-viewer__close {
  color: white;
}
/deep/ .el-image-viewer__img{
  max-width: 80% !important;
  max-height: 80% !important;
}
</style>